/*
 * Copyright (C) 2010 Zaizi Limited.
 * 
 * This file is part of Zaizi's Alfresco FISE integration
 * 
 * Alfresco FISE is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Alfresco FISE is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Alfresco FISE. If not, see <http://www.gnu.org/licenses/>.
 */
package org.zaizi.fiseiks.alfresco.service;

import org.alfresco.service.ServiceRegistry;
import org.zaizi.restclient.RestClient;

/**
 * Abstract utility class for FISE services
 * 
 * @author efoncubierta
 *
 */
public abstract class FiseIksAbstractService {
	// FISE services URLs
	public static final String FISE_STORE = "/store";
	public static final String FISE_STORE_CONTENT = FISE_STORE + "/content";
	public static final String FISE_STORE_METADATA = FISE_STORE + "/metadata";
	
	private ServiceRegistry services;
	private RestClient restClient;
	
	/**
	 * Inject Alfresco's service registry
	 * @param services Alfresco's service registry
	 */
    public void setServiceRegistry(ServiceRegistry services)
    {
        this.services = services;
    }
    
    /**
     * Get Alfresco's service registry
     * @return Alfresco's service registry
     */
    protected ServiceRegistry getServiceRegistry()
    {
    	return this.services;
    }
    
    /**
     * Inject a REST Client for FISE
     * @param restClient REST Client
     */
    public void setRestClient(RestClient restClient)
    {
        this.restClient = restClient;
    }
    
    /**
     * Get a REST Client for FISE
     * @return REST Client
     */
    protected RestClient getRestClient()
    {
    	return this.restClient;
    }
}
